package com.icloud.article.boot.controller.im;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.icloud.article.boot.dto.IMMessageCollectPageDto;
import com.icloud.article.boot.service.IMService;
import com.icloud.article.boot.service.ITIMInviteMessageService;
import com.icloud.article.boot.vo.IMMessageCollectVo;
import com.icloud.common.core.api.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(tags = "IM 接口")
@RequestMapping("/app/im/query")
@RequiredArgsConstructor
public class IMQueryController {
    @Autowired
    private IMService imService;
    @Autowired
    private ITIMInviteMessageService itimInviteMessageService;

    @ApiOperation("查询收藏聊天消息")
    @PostMapping("/tencent/message/collect/page")
    @ResponseBody
    public CommonResult<IPage<IMMessageCollectVo>> messageCollectPage(@Validated @RequestBody IMMessageCollectPageDto dto){
        return CommonResult.success(imService.messageCollectPage(dto));
    }
}
